package com.tsystems.school.jabber.DataBase.DAO;

import com.tsystems.school.jabber.DataBase.Entities.Conference;
import com.tsystems.school.jabber.DataBase.Entities.Server;
import com.tsystems.school.jabber.DataBase.Entities.User;

public class DAOFactory {
	private static DAOFactory instance;

	private static DAO AdminDAO = null;
	private static ServerDAO serverDAO = new ServerDAO(Server.class);
	private static UserDAO userDAO = new UserDAO(User.class);
	private static ConferenceDAO conferenceDAO = new ConferenceDAO(Conference.class);
	private static DAO messageDAO = null;

	private DAOFactory(){}

	public static synchronized DAOFactory getInstance(){
		if(instance == null){
			instance = new DAOFactory();
		}
		return instance;
	}

	public static UserDAO getUserDAO() {
		return userDAO;
	}

	public static ServerDAO getServerDAO() {
		return serverDAO;
	}

	public static ConferenceDAO getConferenceDAO(){
		return conferenceDAO;
	}
}
